package cn.com.dcsgo.util;

import cn.com.dcsgo.api.dto.NotificationDTO;
import cn.com.dcsgo.domain.entity.Notification;

/**
 * NotificationConverter
 *
 * @author Dcsgo
 * @since 2025/4/3 15:37
 */

public class NotificationConverter {
    public static Notification convert(NotificationDTO notificationDTO) {
        Notification notification = new Notification();
        notification.setId(notificationDTO.getId());
        notification.setUserId(notificationDTO.getUserId());
        notification.setType(notificationDTO.getType());
        notification.setMessage(notificationDTO.getMessage());
        notification.setStatus(notificationDTO.getStatus());
        notification.setCreatedAt(notificationDTO.getCreatedAt());
        notification.setUpdatedAt(notificationDTO.getUpdatedAt());
        return notification;
    }

    public static NotificationDTO convert(Notification notification) {
        NotificationDTO notificationDTO = new NotificationDTO();
        notificationDTO.setId(notification.getId());
        notificationDTO.setUserId(notification.getUserId());
        notificationDTO.setType(notification.getType());
        notificationDTO.setMessage(notification.getMessage());
        notificationDTO.setStatus(notification.getStatus());
        notificationDTO.setCreatedAt(notification.getCreatedAt());
        notificationDTO.setUpdatedAt(notification.getUpdatedAt());
        return notificationDTO;
    }
}
